package com.zdp.chat.handler;

import com.alibaba.fastjson.JSON;
import com.zdp.chat.entity.chat.ChatMessageReq;
import com.zdp.chat.entity.chat.inner.TextInner;
import com.zdp.chat.entity.chat.req.TextReq;
import com.zdp.chat.entity.chat.resp.TextResp;
import com.zdp.chat.enums.ContextTypeEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class TextMessageHandler extends AbstractChatMessageHandler<TextReq, TextInner, TextResp> {

    @Override
    public boolean apply(Integer messageType) {
        return ContextTypeEnum.TEXT.getType().equals(messageType);
    }

    @Override
    protected TextReq preValidation(ChatMessageReq<TextReq> req) {
        return super.preValidation(req);
    }

    @Override
    protected TextInner convertInner(TextReq textReq) {
        log.info("text原始消息体:{}", JSON.toJSONString(textReq));



        return null;
    }

    @Override
    protected void roomHandler(TextInner textInner) {

    }

    @Override
    protected void saveMessage(TextInner textInner) {

    }

    @Override
    protected void publishMessageEvent(TextInner textInner) {

    }

    @Override
    protected TextResp convertResp(TextInner textInner) {
        return null;
    }
}
